package com.micro.ai.template.dto.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 模板响应DTO
 *
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@Schema(description = "模板响应")
public class TemplateDTO {

    @Schema(description = "主键ID", example = "abc123...")
    private String id;

    @Schema(description = "模板ID", example = "tpl_1234567890")
    private String templateId;

    @Schema(description = "模板名称", example = "智能客服助手")
    private String templateName;

    @Schema(description = "模板描述", example = "提供7*24小时智能客服服务")
    private String description;

    @Schema(description = "分类ID", example = "customer_service")
    private String categoryId;

    @Schema(description = "分类名称", example = "客服助手")
    private String categoryName;

    @Schema(description = "租户ID", example = "tenant_001")
    private String tenantId;

    @Schema(description = "创建者用户ID", example = "usr_001")
    private String createdBy;

    @Schema(description = "创建者用户名", example = "zhangsan")
    private String createdByUsername;

    @Schema(description = "作者显示名称", example = "张三")
    private String author;

    @Schema(description = "许可证", example = "MIT")
    private String license;

    @Schema(description = "最低系统版本", example = "1.0.0")
    private String minSystemVersion;

    @Schema(description = "是否启用", example = "true")
    private Boolean enabled;

    @Schema(description = "是否公开", example = "true")
    private Boolean isPublic;

    @Schema(description = "审核状态", example = "APPROVED", allowableValues = {"DRAFT", "PENDING", "APPROVED", "REJECTED"})
    private String status;

    @Schema(description = "浏览次数", example = "1250")
    private Integer viewCount;

    @Schema(description = "下载次数", example = "350")
    private Integer downloadCount;

    @Schema(description = "使用次数", example = "1850")
    private Integer useCount;

    @Schema(description = "评分", example = "4.75")
    private BigDecimal ratingScore;

    @Schema(description = "评分人数", example = "128")
    private Integer ratingCount;

    @Schema(description = "标签列表", example = "[\"客服\", \"对话\", \"NLP\"]")
    private List<String> tags;

    @Schema(description = "封面图片URL", example = "https://example.com/cover.jpg")
    private String coverImage;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间", example = "2025-10-25 10:00:00")
    private LocalDateTime createdAt;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间", example = "2025-10-25 15:30:00")
    private LocalDateTime updatedAt;
}

